<?php 
session_start();
if(strlen($_SESSION["u_name"])== 0)
{
 header("Location:index.php");
}
include 'Classes/MyClass.php';
$objMyCass = new MyClass();
$userdetails = array();
$userdetails = $objMyCass->FetchUserRecords($_SESSION["user_id"]);
$choice = $_REQUEST["choice"];

	if($choice == 1)
		{
			$start = 1;
		}				
		else if($choice == 2)
		{
			$start = 21;
		}	
		else if($choice == 3)
		{
			$start = 41;
		}	
		else if($choice == 4)
		{
			$start = 61;
		}	
?>

<?php
	$page =""; 
	$page .='<table cellpadding="0" cellspacing="0" width="60%" align="center">';
	for($i=$start;$i<($start+20);$i++){
		
	if ($i%2==1)
	{	
			$page .="<tr>";
	}
	
	$page .='<td style="height:30px">'.$i.'&nbsp;';

	$bschooldetails = array(); 
	$bschooldetails = $objMyCass->GetBSchoolDetailsForChoice($choice);
	$page .='<select id="ddlBSchool'.$i.'" name="ddlBSchool[]" class="inputgeneral" style="width:200px" >';
	$page .='<option value ="" >-----</option>';
					
		foreach($bschooldetails as &$value)
		{
			if($value["id"] == $i)
			{
				$selected = "selected='selected'";
			}
			else
			{
				$selected="";
			}
								
	$page .='<option value ="'.$value["id"].'" '.$selected.' >'.$value["school_name"].'</option>';
			 
		} 						
	$page .='</select>';
			
	$page .='</td>';

			// When you've looped enough, end the row.
			if ($i%2==0)
			{
			$page .='</tr>';
			}
		} 	
			 
			 
					 
		 
		$page .='</table>';
		
		echo $page;